package com.wzh.example.demo.repository.mapper;

import com.wzh.example.demo.domain.UserDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @Author zh wang
 * @Create 2025/4/14 17:45
 */
public interface UserRepository extends JpaRepository<UserDO, Long> {
    UserDO findByUserName(String username);

    @Modifying
    @Query("update UserDO u set u.email = ?2 where u.userName = ?1")
    void updateEmail(String userName, String mail);
}
